TEST     START   1000              
FIRST    STL     RETADR            
CLOOP    JSUB    RDREC             
         COMP    ONE               
         JEQ     ENDFIL            
         JSUB    WRREC             
         J       CLOOP             
ENDFIL   LDA     EOF               
         RSUB                      
EOF      BYTE    C'EOF'
         ******  ***************
         STL     CLOOPFIRST
         LDA     FIRST
         ******  ***************
THREE    WORD    3
ZERO     WORD    0
LENGTH   RESW    1
BUFFER   RESB    4096              
         ******  ****************
         LDX     A
         LDB     B
         STL     C
         ******  ****************
RDREC    LDX     ZERO              
RLOOP    TD      INPUT             
         JEQ     RLOOP             
EXIT     STCH    BUFFER            
         RSUB                      
INPUT    BYTE    X'F3'             
MAXLEN   WORD    4096 
WRREC    LDX     ZERO              
         RSUB                      
         END     FIRST
